#ifndef SHADER_UTILS_VC_H
#define SHADER_UTILS_VC_H

static
const char* fragment_shader_blender1 =
"  if (uForceBlendCycle1 != 0) {						\n"
"    muxPM[0] = clampedColor;	\n"
"    muxA[0] = clampedColor.a;								\n"
"    lowp float muxa;		\n"
"    if (uBlendMux1[1] == 0)		\n"
"      muxa = muxA[0];		\n"
"    else if (uBlendMux1[1] == 1)		\n"
"      muxa = muxA[1];		\n"
"    else if (uBlendMux1[1] == 2)		\n"
"      muxa = muxA[2];		\n"
"    else if (uBlendMux1[1] == 3)		\n"
"      muxa = muxA[3];		\n"
"    muxB[0] = 1.0 - muxa;		\n"
"    lowp vec4 muxpm0;		\n"
"    if (uBlendMux1[0] == 0)		   \n"
"      muxpm0 = muxPM[0];		      \n"
"    else if (uBlendMux1[0] == 1)		      \n"
"      muxpm0 = muxPM[1];		      \n"
"    else if (uBlendMux1[0] == 2)		      \n"
"      muxpm0 = muxPM[2];		      \n"
"    else if (uBlendMux1[0] == 3)		      \n"
"      muxpm0 = muxPM[3];		      \n"
"    lowp vec4 muxpm2;		\n"
"    if (uBlendMux1[2] == 0)		   \n"
"      muxpm2 = muxPM[0];		      \n"
"    else if (uBlendMux1[2] == 1)		      \n"
"      muxpm2 = muxPM[1];		      \n"
"    else if (uBlendMux1[2] == 2)		      \n"
"      muxpm2 = muxPM[2];		      \n"
"    else if (uBlendMux1[2] == 3)		      \n"
"      muxpm2 = muxPM[3];		      \n"
"    lowp float muxb;		  \n"
"    if (uBlendMux1[3] == 0)		   \n"
"      muxb = muxB[0];		 \n"
"    else if (uBlendMux1[3] == 1)		      \n"
"      muxb = muxB[1];		 \n"
"    else if (uBlendMux1[3] == 2)		      \n"
"      muxb = muxB[2];		 \n"
"    else if (uBlendMux1[3] == 3)		      \n"
"      muxb = muxB[3];		 \n"
"    lowp vec4 blend1 = (muxpm0 * muxa) + (muxpm2 * muxb);	\n"
"    clampedColor.rgb = clamp(blend1.rgb, 0.0, 1.0);				\n"
"  }													\n"
;

static
const char* fragment_shader_blender2 =
"  if (uForceBlendCycle2 != 0) {				\n"
"    muxPM[0] = clampedColor;			\n"
"    muxA[0] = clampedColor.a;							\n"
"    lowp float muxa;           \n"
"    if (uBlendMux2[1] == 0)            \n"
"      muxa = muxA[0];          \n"
"    else if (uBlendMux2[1] == 1)               \n"
"      muxa = muxA[1];          \n"
"    else if (uBlendMux2[1] == 2)               \n"
"      muxa = muxA[2];          \n"
"    else if (uBlendMux2[1] == 3)               \n"
"      muxa = muxA[3];          \n"
"    muxB[0] = 1.0 - muxa;              \n"
"    lowp vec4 muxpm0;		\n"
"    if (uBlendMux2[0] == 0)		   \n"
"      muxpm0 = muxPM[0];		      \n"
"    else if (uBlendMux2[0] == 1)		      \n"
"      muxpm0 = muxPM[1];		      \n"
"    else if (uBlendMux2[0] == 2)		      \n"
"      muxpm0 = muxPM[2];		      \n"
"    else if (uBlendMux2[0] == 3)		      \n"
"      muxpm0 = muxPM[3];		      \n"
"    lowp vec4 muxpm2;		\n"
"    if (uBlendMux2[2] == 0)		   \n"
"      muxpm2 = muxPM[0];		      \n"
"    else if (uBlendMux2[2] == 1)		      \n"
"      muxpm2 = muxPM[1];		      \n"
"    else if (uBlendMux2[2] == 2)		      \n"
"      muxpm2 = muxPM[2];		      \n"
"    else if (uBlendMux2[2] == 3)		      \n"
"      muxpm2 = muxPM[3];		      \n"
"    lowp float muxb;		  \n"
"    if (uBlendMux2[3] == 0)		   \n"
"      muxb = muxB[0];		 \n"
"    else if (uBlendMux2[3] == 1)		      \n"
"      muxb = muxB[1];		 \n"
"    else if (uBlendMux2[3] == 2)		      \n"
"      muxb = muxB[2];		 \n"
"    else if (uBlendMux2[3] == 3)		      \n"
"      muxb = muxB[3];		 \n"
"    lowp vec4 blend2 = muxpm0 * muxa + muxpm2 * muxb;	\n"
"    clampedColor.rgb = clamp(blend2.rgb, 0.0, 1.0);		\n"
"  }											\n"
;

#endif // SHADER_UTILS_VC_H
